package com.train.mgr.modules.biz.dto.request;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.train.mgr.modules.system.dto.request.groups.Insert;
import com.train.mgr.modules.system.dto.request.groups.Update;
import io.swagger.annotations.ApiModelProperty;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

@Data
@Accessors(chain = true)
public class LessonUserExerciseReqDTO{
    @ApiModelProperty(name = "exerciseId", value = "练习id编辑时必填",required = true)
    @NotNull(message = "exerciseId必填", groups = {Update.class})
    private Long exerciseId;

    @ApiModelProperty(name = "lessonId", value = "课时id")
    private Long lessonId;

    @ApiModelProperty(name = "lessonUserStudyId", value = "用户课时学习表id")
    private Long lessonUserStudyId;

    @ApiModelProperty(name = "exerciseType", value = "练习类型（101-AI话术切片，102-话术跟读，103-脱稿演练，104-模拟对话，105-智能复习）",required = true)
    @NotNull(message = "练习类型必填", groups = {Insert.class})
    private Integer exerciseType;

    @ApiModelProperty(name = "finishTime", value = "完成练习时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime finishTime;

    @ApiModelProperty(name = "useTime", value = "用时(秒)")
    private String useTime;

    @ApiModelProperty(name = "completeness", value = "完整度")
    private String completeness;

    @ApiModelProperty(name = "fluency", value = "流畅度")
    private String fluency;

    @ApiModelProperty(name = "confidence", value = "自信度")
    private String confidence;

    @ApiModelProperty(name = "fillWordsStuttering", value = "填充词/卡顿")
    private String fillWordsStuttering;

    @ApiModelProperty(name = "speedVolume", value = "语速音量")
    private String speedVolume;

    @ApiModelProperty(name = "comprehensiveScore", value = "综合分")
    private BigDecimal comprehensiveScore;

    @ApiModelProperty(name = "files", value = "练习文件")
    private List<FileDto> files;

    @Data
    public static class FileDto{
        @ApiModelProperty(name = "fileId", value = "文件id")
        private Long fileId;
        @ApiModelProperty(name = "isPicture", value = "是否封面，1：是")
        private Long isPicture = 0L;
        @ApiModelProperty(name = "fileName", value = "文件名称")
        private String fileName;
        @ApiModelProperty(name = "filePath", value = "文件路径")
        private String filePath;
        @ApiModelProperty(name = "fileType", value = "文件分类（'WORD','PPT','EXCEL','PDF','IMAGE','VIDEO','AUDIO','FLASH'）")
        private String fileType;
    }
}
